import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class TopActions extends StatelessWidget {
  final addUser;
  final delUser;
  final calcPosibility;

  TopActions({Key key, this.addUser, this.delUser, this.calcPosibility})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.zero,
      margin: EdgeInsets.zero,
      width: ScreenUtil().setWidth(750),
      height: ScreenUtil().setHeight(126),
      decoration: BoxDecoration(
        color: Color.fromRGBO(232, 213, 187, 1),
        image: DecorationImage(
            image: AssetImage("images/top_bg.png"), fit: BoxFit.cover),
      ),
      alignment: Alignment.center,
      child: Row(
        children: <Widget>[
          Container(
            width: ScreenUtil().setWidth(300),
            height: ScreenUtil().setHeight(90),
            alignment: Alignment.center,
            child: Text(
              '德州扑克',
              style: TextStyle(
                  color: Colors.white,
                  fontSize: 18.0,
                  decoration: TextDecoration.none),
            ),
          ),
          Container(
            width: ScreenUtil().setWidth(450),
            height: ScreenUtil().setHeight(90),
            color: Color.fromRGBO(255, 255, 255, 0),
            alignment: Alignment.center,
            child: Row(
              children: <Widget>[
                Material(
                  color: Color.fromRGBO(255, 255, 255, 0),
                  child: InkWell(
                    onTap: addUser,
                    child: Container(
                      width: ScreenUtil().setWidth(78),
                      height: ScreenUtil().setHeight(78),
                      margin: EdgeInsets.only(right: ScreenUtil().setWidth(30)),
                      decoration: BoxDecoration(
                        image: DecorationImage(
                            image: AssetImage("images/add.png"),
                            fit: BoxFit.contain),
                      ),
                    ),
                  ),
                ),
                Material(
                  color: Color.fromRGBO(255, 255, 255, 0),
                  child: InkWell(
                    onTap: delUser,
                    child: Container(
                      width: ScreenUtil().setWidth(78),
                      height: ScreenUtil().setHeight(78),
                      margin: EdgeInsets.only(right: ScreenUtil().setWidth(30)),
                      decoration: BoxDecoration(
                        image: DecorationImage(
                            image: AssetImage("images/del.png"),
                            fit: BoxFit.contain),
                      ),
                    ),
                  ),
                ),
                Material(
                  child: InkWell(
                    onTap: calcPosibility,
                    child: Container(
                      width: ScreenUtil().setWidth(141),
                      height: ScreenUtil().setHeight(72),
                      decoration: BoxDecoration(
                        color: Color.fromRGBO(230, 219, 146, 1),
                        borderRadius: BorderRadius.all(
                          Radius.circular(
                            ScreenUtil().setWidth(5),
                          ),
                        ),
                      ),
                      child: Center(
                        child: Text(
                          "计算",
                          style: TextStyle(
                              fontSize: 18.0,
                              color: Color.fromRGBO(0, 3, 0, 1)),
                        ),
                      ),
                    ),
                  ),
                ),
              ],
            ),
          )
        ],
      ),
    );
  }
}
